package com.santoker.user.service.service.common.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.santoker.user.service.dao.AdminUserMapper;
import com.santoker.user.service.model.AdminUser;
import com.santoker.user.service.service.common.IAdminUserService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 管理员表 服务实现类
 * </p>
 *
 * @author Jiangs
 * @since 2020-04-01
 */
@Service
public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser> implements IAdminUserService {

    @Override
    public AdminUser getUserByAccount(String account) {
        LambdaQueryWrapper<AdminUser> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(AdminUser::getIsDelete, 0)
                    .eq(AdminUser::getAccount, account);
        return getOne(queryWrapper, false);
    }

}
